home *** CD-ROM | disk | FTP | other *** search
- class HUD extends MovieClip
- {
- var engine;
- var waterMeter;
- var pause_btn;
- var waterPumped_txt;
- var flowRate_txt;
- var happyKids_txt;
- var tiredKids_txt;
- var available_txt;
- var time_txt;
- var tips;
- function HUD()
- {
- super();
- this.engine = this._parent;
- this.waterMeter.stop();
- this.pause_btn.onRelease = Delegate.create(this,this.pressPause);
- }
- function update(waterPumped, pumpTarget, alreadyPumped, flowRate, happyKids, unhappyKids, availableKids, time)
- {
- this.waterPumped_txt.text = Format.number(waterPumped,2);
- this.flowRate_txt.text = (flowRate < 0 ? "" : "+") + Format.number(flowRate * Engine.FPS * 60,0);
- var _loc2_ = waterPumped / pumpTarget;
- this.waterMeter.gotoAndStop(Math.floor(_loc2_ * (this.waterMeter._totalframes - 1)) + 1);
- this.happyKids_txt.text = "x" + happyKids.toString();
- this.tiredKids_txt.text = "" + unhappyKids.toString();
- this.available_txt.text = "x" + availableKids.toString();
- this.time_txt.text = Math.round(time.toString() / Engine.FPS) + "s";
- this.tips.update();
- }
- function pressPause()
- {
- this.engine.paused = !this.engine.paused;
- }
- }
-